package agenceVoyageVirtuel.shared;

import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public abstract class ErrorDialog {
	public static DialogBox standardErrorDialog(Widget w){
		final DialogBox dialogBox = new DialogBox();
		VerticalPanel panel = new VerticalPanel();
		panel.add(w);
		Button b = new Button("Fermer");
		panel.add(b);
		b.addClickHandler(new ClickHandler() {
			
			@Override
			public void onClick(ClickEvent event) {
				dialogBox.hide();
			}
		});
		dialogBox.add(panel);
		return dialogBox;
	}
}
